package alvarodelrosal.chat.client.chataction.local;

import alvarodelrosal.chat.client.chataction.infraestructuraremota.OnlineConversations;
import alvarodelrosal.chat.client.chataction.infraestructuraremota.AllUsers;
import alvarodelrosal.chat.client.modelo.Conversation;
import java.util.List;

public class ChatWhoIsIn implements ChatLocalAction {

    @Override
    public String getName() {
        return "WhoIsIn";
    }

    @Override
    public void doAction(List<String> parameters) {
        Conversation conversation = OnlineConversations.getConversation(Integer.parseInt(parameters.get(0)));
        for(int userNumber = 1; userNumber < parameters.size(); userNumber++) {
            conversation.addUser(AllUsers.getUser(Integer.parseInt(parameters.get(userNumber))));
        }
    }
    
}
